<?php
/**
 * Created by PhpStorm.
 * user: songlintao
 * Date: 2017/8/24
 * Time: 下午5:51
 */

namespace core\lib;

class baseModel extends Medoo {
	public function __construct() {
		try {
			parent::__construct( CONFIG_DB );
		} catch ( \PDOException $e ) {
			p( $e->getMessage() );
		}
	}

	protected function getTableName() {
		$table_name = strtolower( get_class( $this ) );
		$temp       = explode( '\\', $table_name );

		return $temp[ count( $temp ) - 1 ];
	}
}